package com.RedAndBlack.redandblack;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.RedAndBlack.redandblack.LogicGame;

public class ActivityGame extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.game_menu);
		
        Button btRed = (Button) findViewById(R.id.btRed);
        
        Button btBlack = (Button) findViewById(R.id.btBlack);
        
        final TextView score = (TextView) findViewById(R.id.textView1);
        
        final LogicGame logicGame =  new LogicGame();
        
        logicGame.luckycard();
        
		score.setText(Integer.toString(0));	
        
        OnClickListener listMenu = new OnClickListener() {
		
			@Override
			public void onClick(View v) {
				
				switch (v.getId()) {
				case  R.id.btRed:  
					logicGame.gameProcessed(1);
					score.setText(Integer.toString(logicGame.scorer));
					break;
					
				case R.id.btBlack:
					logicGame.gameProcessed(0);
					score.setText(Integer.toString(logicGame.scorer));
					break;
					
				default:
					break;
				}
				
			}
		};
       
		
		btRed.setOnClickListener(listMenu);
	    btBlack.setOnClickListener(listMenu);
			
		};
		
		

}
